"------------------------
"" Syntax: highlighting
"------------------------
if has('syntax')
    syntax enable             " Turn on syntax highlighting
    silent! colorscheme Tomorrow-Night " Custom color scheme
endif
set nobackup
set clipboard=unnamedplus
set fileencodings=utf8,cp936,gb18030,big5
set number
set relativenumber
set laststatus=2
set mouse=a
set hlsearch
set guifont=Monospace\ 15
set autoindent
set smartindent
set smarttab
"set cindent
set tabstop=4
set shiftwidth=4
set expandtab

call plug#begin()
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline-themes'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --key-bindings --no-completion --no-update-rc' }
Plug 'junegunn/fzf.vim'
Plug 'benekastah/neomake'
Plug 'Shougo/neocomplete.vim'
Plug 'agude/vim-eldar'
call plug#end()

let g:airline_powerline_fonts = 1
let g:airline_theme = "dark"
let g:vim_markdown_folding_disabled = 1
let g:neocomplete#enable_at_startup = 1

autocmd! BufWritePost * Neomake

" Move lines up or down
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
inoremap <C-j> <Esc>:m .+1<CR>==gi
inoremap <C-k> <Esc>:m .-2<CR>==gi
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv

" select all
inoremap <C-a> <esc>ggVG<cr>
nnoremap <C-a> ggVG<cr>

" save
inoremap <C-s> <esc>:w<cr>a
nnoremap <C-s> :w<cr>
